package com.itheima.service.impl;

import com.itheima.mapper.GoodsMapper;
import com.itheima.pojo.Goods;
import com.itheima.service.GoodsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Name GoodsServiceImpl
 * @Author BaiXin
 * @Date 2022-10-19 20:54
 */
@Service
public class GoodsServiceImpl implements GoodsService {
    @Autowired
    private GoodsMapper goodsMapper;
    @Override
    public List<Goods> selectAll() {
        List<Goods> goods = goodsMapper.selectAll();
        return goods;
    }

    @Override
    public void deleteById(Integer id) {
        goodsMapper.deleteById(id);
    }

    @Override
    public void update(Goods goods) {
        goodsMapper.update(goods);
    }

    @Override
    public void add(Goods goods) {
        goodsMapper.add(goods);
    }


}
